Current Location: Home> Function Categories> round

round

Round floating point numbers
Name:round
Category:math
Programming Language:php
One-line Description:Round the floating point number.

Definition and usage

round() function rounds up floating point numbers.

Example

 <?php
echo ( round ( 0.60 ) ) ;
echo ( round ( 0.50 ) ) ;
echo ( round ( 0.49 ) ) ;
echo ( round ( - 4.40 ) ) ;
echo ( round ( - 4.60 ) ) ;
?>

Try it yourself

grammar

 round ( x , prec )
parameter describe
x Optional. Specify the number to be rounded.
prec Optional. Specify the number of digits after the decimal point.

illustrate

Returns the result of rounding x according to the specified precision prec (the number of numbers after decimal decimal points). prec can also be a negative number or zero (default value).

Similar Functions
Popular Articles